package com.itheima.webaitliasserver.mapper;

import com.itheima.webaitliasserver.pojo.Dept;
import com.itheima.webaitliasserver.pojo.Result;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @ClassName: xiaoZhang
 * @Description:
 * @Author: Zhang
 * @CreateDate: 2025-06-26 15:48
 */
@Mapper
public interface DeptMapper {
    @Select("select id, name, create_time , update_time from dept")
    public List<Dept> queryDeptListMapper();

    @Select("select id, name, create_time , update_time from dept where id = #{id}")
    public Dept queryDeptById(Integer deptId);


    @Select("select id, name, create_time , update_time from dept where name = #{name}")
    public Dept queryDeptByName(String name);


    @Delete("delete from dept where id = #{deptId}")
    public void deleteDeptById(Integer deptId);



    @Insert("insert into dept ( name, create_time, update_time ) VALUES (#{name} , #{createTime} , #{updateTime})")
    public void addDept(Dept dept);
}
